<%--
    Document   : addchoice
    Created on : 2012-3-6, 17:00:39
    Author     : xiaoxiao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib  prefix="s"  uri="/struts-tags"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>增加选择题</title>
        <link href="css/global.css" rel="stylesheet" type="text/css">
        <link href="css/form.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                $('#signup').validate({
                    rules: {
                        'addchoice.chapter': {
                            required: true,
                            digits:true
                        }
                    }, //end rules
                    messages: {
                        'addchoice.chapter': {
                            required: '请输入章节',
                            digits: "请输入一个整数"
                        }
                    }
                }); // end validate
            }); // end ready()
        </script>
    </head>
    <body>
        <s:if test="%{#session.islogin}">
            <div id="contentWrap">
                <div id="main">
                    <h2>增加选择题</h2>
                    <s:form action="addchoice" method="post" name="signup" id="signup">
                        <div>
                            <label  class="label">课程 </label>
                            <s:textfield name="addchoice.subject" cssClass="required" id="subject" title="请输入课程"></s:textfield>
                        </div>
                        <div>
                            <label  class="label">章节</label>
                            <s:textfield name="addchoice.chapter"  id="chapter" title="请输入章节号"></s:textfield>
                        </div>
                        <div>
                            <label  class="label">章节信息</label>
                            <s:textfield name="addchoice.chapterinfo" cssClass="required" id="chapterinfo" title="请输入章节信息"></s:textfield>
                        </div>
                        <div>
                            <label  class="label">题型</label>
                            <s:select name="addchoice.type" label="题型" list="{'单选题','多选题'}"></s:select>
                        </div>
                        <div>
                            <label  class="label">难度</label>
                            <s:select name="addchoice.level"  list="{'容易','中等','偏难','难'}" ></s:select>
                        </div>
                        <div>
                            <label  class="label">题目内容</label>
                            <s:textarea name="addchoice.name" cols="15" rows="3" id="qname" cssClass="required" title="请输入题目内容"></s:textarea>
                        </div>
                        <div>
                            <label  class="label">选项A</label>
                            <s:textarea name="addchoice.a" cols="35" rows="2" cssClass="required" title="请输入A选项"></s:textarea>
                        </div>
                        <div>
                            <label  class="label">选项B</label>
                            <s:textarea name="addchoice.b" cols="35" rows="2"  cssClass="required" title="请输入B选项"></s:textarea>
                        </div>
                        <div>
                            <label  class="label">选项C</label>
                            <s:textarea name="addchoice.c" cols="35" rows="2"  cssClass="required" title="请输入C选项"></s:textarea>
                        </div>
                        <div>
                            <label  class="label">选项D</label>
                            <s:textarea name="addchoice.d" cols="35" rows="2"  cssClass="required" title="请输入D选项"></s:textarea>
                        </div>
                        <div>
                            <label  class="label">题目答案</label>
                            <s:textfield name="addchoice.answer"  cssClass="required" title="请输入题目答案"></s:textfield>
                        </div>
                        <div>
                            <input type="reset"  value="重置" id="reset">
                            <input type="submit" name="submit" id="submit" value="添加">
                        </div>
                    </s:form>
                </div>
            </div>

        </s:if>
        <s:else>
            <%
                        response.sendRedirect("login.jsp");
            %>
        </s:else>
    </body>
</html>
